home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / DSIIC2.ARJ / LISTDEMO.C < prev    next >
C/C++ Source or Header  |  1991-07-15  |  945b  |  39 lines

  1. /* Copyright (c) James L. Pinson 1990,1991  */
  2.  
  3. /**********************   LISTDEMO.C   ***************************/
  4.  
  5. #include "mydef.h"
  6. #include <stddef.h>
  7. #include <stdio.h>
  8.  
  9. int start(int argc, char *argv[])      /* start is the entry point */
  10. {
  11. extern struct screen_structure scr;
  12. extern struct window_structure w[];
  13.  
  14. char string[30];
  15. int select_win;
  16. int selection;
  17. char *ptr[11]= {
  18.                 "Apple     ", "Boat      ", "Berry     ",
  19.                 "Car       ", "Computer  ", "Denver    ",
  20.                 "Donut     ", "Dog       ", "Elephant  ",
  21.                 "Egg       ", NULL
  22.                 };
  23. cls();
  24.  
  25. select_win= win_make(1,2,10,5,STD_FRAME,"",scr.normal,scr.normal);
  26.  
  27. selection=list_select(ptr);
  28.  
  29. win_delete(select_win);
  30.  
  31.  if (selection==-1) print(1,1,"No selection made");
  32.   else {
  33.     sprintf(string,"Item number %i was selected",selection);
  34.     print(1,1,string);
  35.   }
  36.  
  37. return(0);
  38. }
  39.